/*
 * @Author: liu
 * @Date: 2024-04-21 00:18:14
 * @LastEditors: liu
 * @LastEditTime: 2024-04-21 23:26:51
 * @FilePath: \yyx_ser_ts\app\model\Course.ts
 * @Description:
 * 天道酬勤
 */
import { Model, Table, Column } from 'sequelize-typescript'
import { Optional } from 'sequelize'

interface CourseAttributes {
  id: number
  title: string
  lesson_num: number
  cat_id: number
  teacher: string
  brief: string
  cover_url: string
  discounts: number
  price: number
  sales: number
  discountsTag: string
  details: string
}

interface CourseCreationAttributes extends Optional<CourseAttributes, 'id'> {}

@Table({
  tableName: 'courses'
})
export default class Course extends Model<
  CourseAttributes,
  CourseCreationAttributes
> {
  @Column
  title!: string
  @Column
  lesson_num!: number
  @Column
  cat_id!: number
  @Column
  teacher!: string
  @Column
  brief!: string
  @Column
  cover_url!: string
  @Column
  discounts!: number
  @Column
  price!: number
  @Column
  sales!: number
  @Column
  discountsTag!: string
  @Column
  details!: string
}
